package com.aisile.crowd_funding.common.controller;

import com.aisile.crowd_funding.system.pojo.SysUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class BaseController {

    public Subject getSubject(){

        return SecurityUtils.getSubject();
    }

    public SysUser getLoginUser(){

        return (SysUser) getSubject().getPrincipal();
    }

    public String getLoginUserName(){

        return getLoginUser().getUsername();
    }
}
